<?php

/**
 * model_absent
 */

class Model_absent extends YOU {

	public function __construct()
	{
		parent::__construct();
	}

	/** 取得当前阶段班级某一节代课信息 **/
	public function getInfo($semester_id, $class_id, $week, $section, $staff_id)
	{
		$where = " WHERE semester_id='{$semester_id}' AND class_id='{$class_id}' AND absent_week='{$week}' AND absent_section='{$section}' AND from_staff='{$staff_id}' ";
		
		$stime = date("Y-m-d H:i:s");
		
		$where .= " AND start_time <='{$stime}' AND end_time>='{$stime}' ";
		
		$sql = "SELECT * FROM `tbl_absent` {$where} ";
		$data = $this->db->fetchRow($sql);
		
		return $data;
	}
	
	/** 取得某老师的某学月请假数据 **/
	public function getMonthCountByStaff($staff_id, $semester_id, $month)
	{
		$row = $this->db->fetchRow("SELECT 	COUNT(1) AS count FROM `tbl_absent`  WHERE ");
		
	}

}



?>